package com.java.model;

import lombok.Data;

import java.io.Serializable;

@Data
public class Result implements Serializable{

    private static final long serialVersionUID = 5712367830031773930L;

    private String code;

    private String msg;

    private Object data;
    /**
     * 查询总数count
     */
    private Long count;


    public Result(String code, String msg, Object data, Long count){
        this.code = code;
        this.msg = msg;
        this.data = data;
        this.count = count;
    }
    public static Result success(){
        return new Result("0",null,null,null);
    }

    public static Result success(Object data,Long count){
        return new Result("0",null,data,count);
    }

    public static Result error(String msg){
        return new Result("1",msg,null,null);
    }
}
